<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui">
<body>
	<ui:composition>

		<p:dataTable var="poItem" value="#{bean.items}" style="width:100%;">
			<p:column headerText="Item #" style="width:5%;">
				<h:outputText value="#{poItem.itemNumber}" />
			</p:column>
			<p:column headerText="Description" style="width:38%;">
				<h:outputText value="#{poItem.partUnit.shortName}" />
			</p:column>
			<p:column headerText="Brand" style="width:12%;">
				<h:outputText value="#{poItem.partUnit.shortBrand}" />
			</p:column>
			<p:column headerText="Part #" style="width:8%;">
				<h:outputText value="#{poItem.partUnit.part}" />
			</p:column>
			<p:column headerText="Quantity" style="width:5%;text-align: center;">
				<h:outputText value="#{poItem.quantity}">
					<f:convertNumber integerOnly="true" />
				</h:outputText>
			</p:column>
			<p:column headerText="Unit" style="width:5%;text-align: center;">
				<h:outputText value="&nbsp;#{poItem.partUnit.shortUnit}" />
			</p:column>
			<p:column headerText="Price/Unit" style="text-align: right;width:10%;">
				<h:outputText value="#{poItem.pricePerUnit}">
					<f:convertNumber currencySymbol="" type="currency" />
				</h:outputText>
			</p:column>
			<p:column headerText="Sub-Total" style="text-align: right;width:7%;">
				<h:outputText value="#{poItem.totalPrice}">
					<f:convertNumber currencySymbol="" type="currency" />
				</h:outputText>
			</p:column>
			<p:column headerText="Delete" rendered="#{not readonly}" style="text-align: center;width:10%;">
				<p:commandButton value="Delete" update="#{deleteUpdate}" ajax="false"
					action="#{backingBean.deletePoItem}" >
					<f:param name="poItemId" value="#{poItem.id}" />
				</p:commandButton>
			</p:column>

		</p:dataTable>

	</ui:composition>
</body>
</html>